//
//  SubjectTwoManualViewController.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/24.
//

#import "SubjectTwoManualViewController.h"

#import "SubjectTwoManualCell.h"
@interface SubjectTwoManualViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    UITableView *_Tabview;
    SubjectTwoManualCell *Cell;
}
@end

@implementation SubjectTwoManualViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    //隐藏头部view
    self.navigationController.navigationBar.hidden = YES;
    NavigationHeadView *navgationheadv = [[NavigationHeadView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, SafeAreaTopHight)];
    navgationheadv.titlelabel.text = @"科二手动播报";
    navgationheadv.titlelabel.textColor = [UIColor blackColor];
    navgationheadv.backbtn.hidden = NO;
    [navgationheadv.rightbtn setTitle:@"内容编辑" forState:0];
    [navgationheadv.rightbtn setTitleColor:rgba(22, 120, 255, 1) forState:0];
    navgationheadv.rightbtn.hidden = NO;
    [navgationheadv.backbtn addTarget:self action:@selector(returnback) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:navgationheadv];


    _Tabview  = [[UITableView alloc]initWithFrame:CGRectMake(0, SafeAreaTopHight, APPwidth, APPheight)];
    _Tabview.delegate = self;
    _Tabview.dataSource = self;
    _Tabview.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_Tabview];
    
    UIButton *bmBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/2-328/2, APPheight-SafeAreaBottomHeight-45, 328, 45)];
    [bmBtn setTitle:@"新增" forState:0];
    bmBtn.contentHorizontalAlignment = 0;
    [bmBtn setBackgroundColor:rgba(22, 120, 255, 1)];
    [bmBtn setTitleColor:[UIColor whiteColor] forState:0];
    bmBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    bmBtn.layer.cornerRadius = 45/2;
    [self.view addSubview:bmBtn];

    
}
#pragma mark - UITableView DataSource

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 80;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 6;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString * str = @"cell";
    
    Cell  = [tableView dequeueReusableCellWithIdentifier:str];
    if (Cell == nil) {
        
        Cell = [[SubjectTwoManualCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier:str];
    }
    
//    Cell.nameLab.text = @"学员:小芒果";
    
    Cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return Cell;
}


-(void)returnback{
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -视图即将出现
-(void)viewWillAppear:(BOOL)animated{
        
    ((TabbarController *)self.tabBarController).tabBarView.hidden = YES;
    
}


@end
